package com.sky.task;


import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.time.LocalDateTime;

//自定义定时任务
@Component//该类需要实例化
@Slf4j//日志
public class MyTask {

    //每隔五秒打印一次日志
//    @Scheduled(cron = "0/5 * * * * ?")
//    public void printTime(){
//        log.info("当前时间:{}", LocalDateTime.now());
//    }
}
